<!DOCTYPE html>
<html>

<body>
    <script>
        function changeImage() {
            element = document.getElementById('myimage')
            if (element.src.match("bulbon")) {
                element.src = "/i/eg_bulboff.gif";
            } else {
                element.src = "/i/eg_bulbon.gif";
            }
        }
    </script>

    <img id="myimage" onclick="changeImage()" src="/i/eg_bulboff.gif">

    <p>点击灯泡来点亮或熄灭这盏灯</p>

</body>

</html>
